<template>
  <div>
    <a-select :placeholder="$t('user.verification-code.required11156612811')" show-search :default-active-first-option="false" v-model="keyword" @inputKeydown="filte1rOption($event)"
      :showArrow="false" :filterOption="false">
      <a-select-option v-for="item in userList" :value="item.value" :key="item.value">
        {{ item.label }}
      </a-select-option>
    </a-select>
  </div>
</template>

<script>
import { getUserList } from '@/api/common/form';


export default {
  props: {
    disabled: {
      type: Boolean
    },
  },
  created() {

  },
  data() {
    return {
      userList: [],
      selectValue: "",
      timerId: ''
    }
  },
  methods: {
    // Peter.Sun@bmw.com
    async filte1rOption(value) {
      if(this.timerId) {
        if (event.key === 'Enter' || event.keyCode === 13) {
          const value = event.target.value;
          const {data} = await getUserList({UserEmail: value, UserName: value})
          this.userList = data
          console.log("search:", this.userList)
        }
      }
    },
    filterOption(input, option) {
      return (
        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
      );
    },
    selectUser() { }
  }
}
</script>

<style></style>